<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;

class CreateSettingGroupsTable extends Migration
{
    public function up()
    {
        Schema::create('setting_groups', function (Blueprint $table) {
            $table->increments('id');

            $table->string('display_name')->comment('名称，用于展示');
            $table->string('name')->comment('名称，用于系统调用');
            $table->boolean('enable')->default(true)->comment('是否启用');
            $table->unsignedTinyInteger('order')->default(0);

            $table->unique('name');
        });
    }

    public function down()
    {
        Schema::dropIfExists('setting_groups');
    }
}
